using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class NewBornMap : EntityTypeConfiguration<NewBorn>
    {
        public NewBornMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.BloodGroup)
                .HasMaxLength(50);

            this.Property(t => t.Pediatric)
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("NewBorn");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.BirthDate).HasColumnName("BirthDate");
            this.Property(t => t.Twin).HasColumnName("Twin");
            this.Property(t => t.Product).HasColumnName("Product");
            this.Property(t => t.TransferredTO).HasColumnName("TransferredTO");
            this.Property(t => t.Height).HasColumnName("Height");
            this.Property(t => t.Weight).HasColumnName("Weight");
            this.Property(t => t.BloodGroup).HasColumnName("BloodGroup");
            this.Property(t => t.Pediatric).HasColumnName("Pediatric");
            this.Property(t => t.Admission).HasColumnName("Admission");
            this.Property(t => t.Hour).HasColumnName("Hour");
            this.Property(t => t.Minute).HasColumnName("Minute");
        }
    }
}
